package com.xidian.edu.cn.seckill.scheduled;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Slf4j
//@EnableScheduling
//@EnableAsync
@Component
public class ScheduledDemoController {

//    @Async
    @Scheduled(cron = "*/5 * * * * ?")
    public void scheduledPrintln() throws InterruptedException {

        log.info("Hello World!");
        Thread.sleep(3000);

    }
}
